package com.hzdl.flower.controller;

import com.hzdl.flower.mapper.CartMapper;
import com.hzdl.flower.service.CartService;
import com.hzdl.flower.util.HzdlJsonAjax;
import com.hzdl.flower.vo.CartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("cart")
public class CartController {

    @Autowired
    private CartService cartService;

    @ResponseBody
    @RequestMapping("delCart")
  public HzdlJsonAjax delCart(CartVo cartVo){
        int i = cartService.delCartById(cartVo);
        if (i!=0){
            return new HzdlJsonAjax("删除成功", 1);
        }
        return new HzdlJsonAjax("删除失败", 0);
  }

}
